/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};

/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {

/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId])
/******/ 			return installedModules[moduleId].exports;

/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			exports: {},
/******/ 			id: moduleId,
/******/ 			loaded: false
/******/ 		};

/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);

/******/ 		// Flag the module as loaded
/******/ 		module.loaded = true;

/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}


/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;

/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;

/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";

/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {

	/**
	 * Created by Administrator on 2017/3/14.
	 */
	var Tooltip = __webpack_require__(2);
	var InvestDetail = React.createClass({displayName: "InvestDetail",
	    getInitialState:function(){
	        return{
	            ProDetail:this.props.ProDetail
	        }
	    },
	    //导出PDF文件
	    exportPDF:function(){
	        //console.log(this.refs.getRealDom);
	        this.props.exportPDF.onClick(this.refs.getRealDom.outerHTML);
	    },
	    setMessage:function(orderStatus,isRefund){
	        var msg = {};
	        switch (orderStatus){
	            case 6:
	                msg = {
	                    statusText: "处理中"
	                };
	                break;
	            case 70:
	                msg = {
	                    statusText: "支付失败",
	                    tips:"对不起，该订单交易处理失败，请您稍后再试或者咨询：95039"
	                };
	                break;
	            case 60:
	                msg = {
	                    statusText: "项目流标",
	                    status:"",//项目状态
	                    money:{//金额
	                        key:"流标金额",
	                        value:0
	                    },
	                    time:{//时间
	                        key:"投资时间",
	                        value:""
	                    },
	                    tips:""
	                };
	                if(isRefund){
	                    msg.status = "项目流标，已退款";
	                    msg.tips = "您的流标资金已退至您投标时绑定的回款账户，请注意查收。如超期未收到退款，请及时联系平台客服。";
	                }else{
	                    msg.status = "项目流标，未退款";
	                    msg.tips = "由于您投资的项目未能成立，您的投标资金已进行退款处理，相关资金最快将在本项目投标结束日后3个工作日内（如遇节假日将顺延）退至您投标时绑定的回款账户，请注意查收。如超期未收到退款，请及时联系银行客服。";
	                }
	                break;
	            case 10:
	                msg = {
	                    statusText: "项目超募",
	                    status:"",//项目状态
	                    money:{//金额
	                        key:"超募金额",
	                        value:0
	                    },
	                    time:{//时间
	                        key:"超募时间",
	                        value:""
	                    },
	                    tips:""
	                };
	                if(isRefund){
	                    msg.status = "项目超募，已退款";
	                    msg.tips = "您的超募资金已退至您投标时绑定的回款账户，请注意查收。如超期未收到退款，请及时联系平台客服。";
	                }else{
	                    msg.status = "项目超募，待退款";
	                    msg.tips = "由于您投资的项目已超募，您的投标资金已进行退款处理，相关资金最快将在本项目投标结束日后3个工作日内（如遇节假日将顺延）退至您投标时绑定的回款账户，请注意查收。如超期未收到退款，请及时联系银行客服。";
	                }
	                break;
	            case 20:
	                msg = {
	                    statusText: "回收完成",
	                    status:"已回款",//项目状态
	                    money:{//金额
	                        key:"回款本金",
	                        value:0
	                    },
	                    earnings:{
	                        key:"回款收益",
	                        value:0
	                    },
	                    time:{//时间
	                        key:"回款时间",
	                        value:""
	                    },
	                    tips:"您本次投标的本金和收益已支付至您投标时绑定的回款账户并将于1-3个工作日内到账，请注意查收。如超期未收到款项，请及时联系平台客服。"
	                };
	                break;
	            case 30:
	                msg = {
	                    statusText: "回款中",
	                    status:"回款中",//项目状态
	                    money:{//金额
	                        key:"回款本金",
	                        value:0
	                    },
	                    earnings:{
	                        key:"回款收益",
	                        value:0
	                    },
	                    time:{//时间
	                        key:"原定回款日",
	                        value:""
	                    },
	                    tips:"您本次投标的本金和收益正在回款中，请耐心等候。"
	                };
	                break;
	            case 40:
	                msg.statusText = "计息中";break;
	            case 50:
	                msg.statusText = "已投标待起息";break;
	        }
	        return msg;
	    },
	    render:function(){
	        var _this = this;
	        var ProDetail = _this.state.ProDetail,
	            orderStatus = ProDetail.UserCenterOrderStatus;
	        var ProjectMessage = this.setMessage(orderStatus,ProDetail.IsRefund);
	        //数字格式化
	        var IncomeAmount = UFormatter.formatMoney(Number(ProDetail.IncomeAmount),2),//预期收益
	            PayAmount = UFormatter.formatMoney(Number(ProDetail.PayAmount),2),//投资本金
	            ProjectAmount = Number(ProDetail.ProjectAmount);//项目规模
	        if(ProjectAmount < 10000){
	            ProjectAmount = UFormatter.formatMoney(ProjectAmount,2) + "元";
	        }else{
	            ProjectAmount = UFormatter.formatMoney(ProjectAmount/10000,2) + "万元";
	        }

	        return(
	            React.createElement("div", {className: "invest-detail"}, 
	                React.createElement("div", {ref: "getRealDom"}, 
	                    React.createElement("h1", null, 
	                        ProDetail.ProjectName, 
	                        ProDetail.ProjectType ?
	                            ProDetail.IsExclusivePublic ?
	                                React.createElement(Tooltip, {title: "专属项目，需输入项目专属识别码才可投标", className: "bg-icon iconfont icon-zhuang tooltip"}) :
	                                React.createElement("span", {className: "bg-icon tag tag-zhuang"}) : "", 
	                        
	                        ProDetail.UserCenterOrderStatus ?
	                            React.createElement("span", {className: "tag " + "tag-red"}, ProjectMessage.statusText) : ""
	                        
	                    ), 

	                    (orderStatus == 10 || orderStatus == 20 || orderStatus == 30 || orderStatus == 60) ?
	                        React.createElement("div", {className: "failure-tips"}, 
	                            React.createElement("p", null, 
	                                "项目状态：", React.createElement("span", {className: "fc-main"}, ProjectMessage.status), React.createElement("em", null), 
	                                ProjectMessage.money.key, "：", React.createElement("span", {className: "fc-main"}, PayAmount), "元", React.createElement("em", null), 
	                                ProjectMessage.earnings ?
	                                    React.createElement("span", null, ProjectMessage.earnings.key, ":", React.createElement("span", {className: "fc-main"}, IncomeAmount), "元", React.createElement("em", null)):"", 
	                                /*预期收益=投资总额*年化利率*项目期限/365，保留小数后两位，单位元*/
	                                ProjectMessage.time.key, "：", React.createElement("span", {className: "fc-main"}, ProDetail.RepayBegin)
	                            ), 
	                            React.createElement("p", {className: "fc-light"}, ProjectMessage.tips)
	                        ) :
	                        orderStatus == 70 ?
	                            React.createElement("div", {className: "failure-tips"}, 
	                                React.createElement("p", {className: "fc-light"}, ProjectMessage.tips)
	                            ) : "", 
	                    

	                    (orderStatus == 6 || orderStatus == 50 || orderStatus == 40) ?
	                        React.createElement("div", {className: "money"}, 
	                            React.createElement("ul", {className: "clearfix"}, 
	                                React.createElement("li", null, React.createElement("p", {className: "fc-main"}, React.createElement("b", {className: "fs42"}, IncomeAmount), "元"), 
	                                    React.createElement("p", {className: "fc-light"}, "预期收益")), 
	                                React.createElement("li", null, React.createElement("p", null, React.createElement("b", null, PayAmount), "元"), 
	                                    React.createElement("p", {className: "fc-light"}, "投资本金"))
	                            )
	                        ) : "", 
	                    

	                    React.createElement("div", {className: "info"}, 
	                        React.createElement("ul", {className: "clearfix"}, 
	                            React.createElement("li", null, React.createElement("p", null, ProDetail.Duration + "天"), 
	                                React.createElement("p", {className: "fc-light"}, "投资期限")), 
	                            React.createElement("li", null, React.createElement("p", {className: "fc-main"}, React.createElement("b", null, ProDetail.InvestmentInterest), "%"), 
	                                React.createElement("p", {className: "fc-light"}, "年化利率")), 
	                            React.createElement("li", null, React.createElement("p", null, ProjectAmount), 
	                                React.createElement("p", {className: "fc-light"}, "项目规模"))
	                        )
	                    ), 
	                    React.createElement("div", {className: "pro-data"}, 
	                        React.createElement("ul", {className: "clearfix"}, 
	                            React.createElement("li", null, "项目起息日：", ProDetail.ValueBegin), 
	                            React.createElement("li", null, "项目到期日：", ProDetail.RepayBegin), 
	                            React.createElement("li", null, "还款方式：到期一次性还本付息")
	                        )
	                    ), 
	                    React.createElement("div", {className: "bank-back clearfix"}, 
	                        React.createElement("label", {className: "f-left"}, "回款账户："), 
	                        React.createElement("div", {className: "input f-left"}, 
	                            React.createElement("span", {className: "bank-logo "+ProDetail.CallbackAccount.BankLogo}), 
	                            React.createElement("span", null, ProDetail.CallbackAccount.AccountNo)
	                        )
	                    )
	                ), 
	                React.createElement("span", {className: "angle angle-right-bottom"})
	            )
	        )
	    }
	});

	var Root = React.createClass({displayName: "Root",
	    getInitialState:function(){
	        return{
	            ProDetail:PageDM.ProDetail.value,
	            realName:PageDM.realNameInfo.value
	        }
	    },
	    componentDidMount: function(){
	        var _this = this;
	        var PageDM = window.PageDM;
	        UEventHub.emit("pageLoad","hello world!");

	        //项目详情
	        UEventHub.on(PageDM.ProDetail.dmbind + UI_EVENT_CONST.SET_UDM_VALUE_EVENT, function(v){
	            _this.setState({
	                ProDetail:v
	            })
	        });
	        //个人实名信息
	        UEventHub.on(PageDM.realNameInfo.dmbind + UI_EVENT_CONST.SET_UDM_VALUE_EVENT, function(v){
	            _this.setState({
	                realName:v
	            })
	        });
	    },
	    render: function () {
	        return (
	            React.createElement("div", null, 
	                React.createElement("div", {className: "mod-account container"}, 
	                    React.createElement("div", {className: "account", style: {width:"870px",margin:"0 auto",minHeight:"auto"}}, 
	                        React.createElement(InvestDetail, {url: PageDM.URL, ProDetail: this.state.ProDetail, exportPDF: PageDM.exportPDF, printBtn: PageDM.printBtn}), 
	                        React.createElement("div", {style: {textAlign:"center",marginTop:"20px"}}, 
	                            React.createElement("button", {id: "printBtn", className: "ucs-btn ucs-btn-confirm", onClick: PageDM.printBtn.onClick}, "打印")
	                        )
	                    ), 
	                    React.createElement("div", {className: "clear"})
	                )
	            )
	        )
	    }
	});
	ReactDOM.render(React.createElement(Root, null), document.getElementById('giraffe'));

/***/ }),
/* 1 */,
/* 2 */
/***/ (function(module, exports) {

	/**
	 *
	 * @constructs
	 */
	var Tooltip = React.createClass({displayName: "Tooltip",
	    _addEventListener:function(obj,ev,fn){
			obj.addEventListener ? obj.addEventListener(ev,fn,false) : obj.attachEvent("on" + ev,fn)
	    },
	    _removeEventListener: function (obj, ev, fn) {
	        obj.removeEventListener ? obj.removeEventListener(ev, fn, false) : obj.detachEvent("on" + ev, fn)
	    },
		getDefaultProps: function() {
			return {
				container: document.body,
				position: 'top',
				fixed: true,
				space: 5
			}
		},
		componentDidMount: function() {
			this.container = this.props.container || document.body;
			this.componentEl = this.refs.tooltipbox;
			this.tooltipEl = document.createElement('div');

			var tooltipArrowEl = document.createElement('div');
			tooltipArrowEl.className = 'ucs-tooltip-arrow';

			var tooltipContentEl = document.createElement('div');
			tooltipContentEl.className = 'ucs-tooltip-inner';
			tooltipContentEl.innerHTML = this.props.title;

			this.tooltipEl.appendChild(tooltipArrowEl);
			this.tooltipEl.appendChild(tooltipContentEl);
			this.tooltipEl.className = 'ucs-tooltip ' + this.props.position;
			this.container.appendChild(this.tooltipEl);
			this.resetTooltip();
			var _componentEl =  this.componentEl;
			this._addEventListener(_componentEl, this.props.fixed ? 'mouseenter' : 'mousemove', this.handleMouseMove.bind(this));
			this._addEventListener(_componentEl, 'mouseleave', this.handleMouseOut.bind(this));
		},

		resetTooltip: function() {
			this.tooltipEl.style.left = '-500px';
			this.tooltipEl.style.top = '-500px';
			this.tooltipEl.style.visibility = "hidden";
		},

		handleMouseMove: function(e) {
			if(!this.props.title) {
				return;
			}

			var tooltipPosition = this.getTooltipPosition(e);
			var tooltipOffset = this.getTooltipOffset();

			this.tooltipEl.style.left = tooltipPosition.x + tooltipOffset.x + 'px';
			this.tooltipEl.style.top = tooltipPosition.y + tooltipOffset.y + 'px';
			this.tooltipEl.style.visibility = "visible";
		},

		handleMouseOut: function() {
			this.resetTooltip();
		},
		//定位到标签的位置
		getTooltipPosition: function(e) {
			var pointX;
			var pointY;
			var bodyRect = document.body.getBoundingClientRect();
			var containerRect = this.container.getBoundingClientRect();
			var containerOffsetX = containerRect.left - bodyRect.left;
			var containerOffsetY = containerRect.top - bodyRect.top;
			if(this.props.fixed) {
				var componentRect = this.componentEl.getBoundingClientRect();
				var componentOffsetX = componentRect.left - containerOffsetX;
				var componentOffsetY = componentRect.top - containerOffsetY;
				var componentWidth = this.componentEl.offsetWidth;
				var componentHeight = this.componentEl.offsetHeight;
				var cOffsetX = 0;
				var cOffsetY = 0;
				switch(this.props.position) {
					case 'top':
						cOffsetX = componentWidth / 2;
						cOffsetY = 0;
						break;
					case 'right':
						cOffsetX = componentWidth;
						cOffsetY = componentHeight / 2;
						break;
					case 'bottom':
						cOffsetX = componentWidth / 2;
						cOffsetY = componentHeight;
						break;
					case 'left':
						cOffsetX = 0;
						cOffsetY = componentHeight / 2;
						break;
				}
				pointX = componentOffsetX + cOffsetX + (window.scrollX || window.pageXOffset || document.documentElement.scrollLeft || 0);
				pointY = componentOffsetY + cOffsetY + (window.scrollY || window.pageYOffset || document.documentElement.scrollTop || 0);
			} else {
				var clientX = e.clientX;
				var clientY = e.clientY;
				pointX = clientX - containerOffsetX + (window.scrollX || window.pageXOffset || document.documentElement.scrollLeft || 0);
				pointY = clientY - containerOffsetY + (window.scrollY || window.pageYOffset || document.documentElement.scrollTop || 0);
			}
			return {
				x: pointX,
				y: pointY
			};
		},
		//获取偏移量
		getTooltipOffset: function() {
			var tooltipW = this.tooltipEl.offsetWidth;
			var tooltipH = this.tooltipEl.offsetHeight;
			var offsetX = 0;
			var offsetY = 0;
			switch(this.props.position) {
				case 'top':
					offsetX = -(tooltipW / 2);
					offsetY = -(tooltipH + Number(this.props.space));
					break;
				case 'right':
					offsetX = Number(this.props.space);
					offsetY = -(tooltipH / 2);
					break;
				case 'bottom':
					offsetX = -(tooltipW / 2);
					offsetY = Number(this.props.space);
					break;
				case 'left':
					offsetX = -(tooltipW + Number(this.props.space));
					offsetY = -(tooltipH / 2);
					break;
			}
			return {
				x: offsetX,
				y: offsetY
			};
		},
		render: function() {
			return (
			    React.createElement("div", {ref: "tooltipbox", className: this.props.className?("ucs-tooltip-wrap "+this.props.className):"ucs-tooltip-wrap"}, this.props.children)
	        )
		}
	});

	module.exports = Tooltip;

/***/ })
/******/ ]);